<%@page import="org.jeecgframework.web.util.StaticValue"%>
<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>影院</title>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<script type="text/javascript" src="plug-in/ckfinder/ckfinder.js"></script>
<link rel="stylesheet" href="plug-in/uploadify/css/uploadify.css" type="text/css" />
<script type="text/javascript" src="plug-in/uploadify/jquery.uploadify-3.1.min.js"></script>
<script type="text/javascript">
$(function(){
    var id = $("#id").val();
	if($("input[name='isNormal']:checked").val() == '<%=StaticValue.DIC_TRUE_OR_FALSE_NUM_0%>'){
		$("input[name='exceptionReason']").attr("disabled","disabled");
	}
	$("input[name='isNormal']").change(function(){
		if($(this).val() == "0"){
			$("input[name='exceptionReason']").attr("disabled","disabled").removeAttr("datatype");
		}else{
			$("input[name='exceptionReason']").removeAttr("disabled").attr({"datatype":"*"});
		}
	});

	var list = $("#list").val();
	if(list>0){
        $("#fileName").show();
	}
    $("#taxRegImgUpload").uploadify({
        buttonText : '上传文件',
        auto : true,
        progressData : 'speed',
        multi : true,
        height : 20,
        width : 60,
        overrideEvents : ['onDialogClose'],
        fileTypeDesc : '文件格式:',
        queueID : 'instructionfile',
        fileTypeExts : '*.*',
        fileSizeLimit : '15MB',
        swf : 'plug-in/uploadify/uploadify.swf',
        uploader : 'fileUploadController.do?uploadFileView&businessKey='+id,
        onUploadSuccess : function(file,data) {
            var json = $.parseJSON(data).attributes;
            $("#rectification").val(1); //有整改函
            $("#fileName").show();
            $("#fileUploadname").text(json.name);
			tip("上传成功！");
        },onFallback : function(){
            tip("您未安装FLASH控件，无法上传文件！请安装FLASH控件后再试");
        },onSelectError : function(file, errorCode, errorMsg){
            switch(errorCode) {
                case -100:
                    tip("上传的文件数量已经超出系统限制的"+$('#instruction').uploadify('settings','queueSizeLimit')+"个文件！");
                    break;
                case -110:
                    tip("文件 ["+file.name+"] 大小超出系统限制的"+$('#instruction').uploadify('settings','fileSizeLimit')+"大小！");
                    break;
                case -120:
                    tip("文件 ["+file.name+"] 大小异常！");
                    break;
                case -130:
                    tip("文件 ["+file.name+"] 类型不正确！");
                    break;
            };
        }
    });
});


function delFile( ){
    var id = $("#id").val();
	$.ajax({
		url : "fileUploadController.do?delFile",
		data : {
            businessKey : id
		},
		cache : false,
		dataType : 'json',
		type : 'POST',
		async : false,
		success : function(data){
			if(!data.success){
				tip(data.msg);
				return false;
			}else{
                $("#fileName").hide();
                tip("删除成功！");
			}
		}
	});

}

</script>
</head>
<body>
<t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" action="zyCinemaController.do?doUpdate" tiptype="3">
	<input id="id" name="id" type="hidden" value="${zyCinemaPage.id }">
	<input name="isDelete" type="hidden" value="${zyCinemaPage.isDelete }">
	<input id="list" name="list" type="hidden" value="${fn:length(list)}">
	<input id="rectification" name="rectification" type="hidden" value="0">
	<table cellpadding="0" cellspacing="1" class="formtable">
		<tr>
			<td align="right" style="width: 100px;">
				<label class="Validform_label">影院中文名称:</label>
			</td>
			<td class="value" style="width: 300px;">
				<input id="name" name="name" type="text" style="width: 260px" class="inputxt"  datatype="*" value='${zyCinemaPage.name}' ajaxurl="zyCinemaController.do?checkCinemaNameUnique&cinemaId=${zyCinemaPage.id }" />
			</td>
			<td align="right" style="width: 100px;">
				<label class="Validform_label">影院英文名称:</label>
			</td>
			<td class="value" style="width: 300px;">
				<input id="ename" name="ename" type="text" style="width: 150px" class="inputxt" value='${zyCinemaPage.ename}' />
			</td>
		</tr>
		<tr>
			<td align="right">
				<label class="Validform_label">影院推广名称:</label>
			</td>
			<td class="value">
				<input id="spreadName" name="spreadName" type="text" style="width: 260px" class="inputxt" datatype="*" value='${zyCinemaPage.spreadName}' />
			</td>
			<td align="right">
				<label class="Validform_label">所属机构:</label>
			</td>
			<td class="value" id="org">
				<input name="belongOrg.id" type="hidden" id="belongOrg" value='${zyCinemaPage.belongOrg.id}' />
                <input name="shortname" class="inputxt" id="shortname" readonly="readonly" value='${zyCinemaPage.belongOrg.shortname}' />
                <t:choose hiddenName="belongOrg" hiddenid="id" url="zyContactsController.do?zyOrgs" name="orgList" width="400px" height="550px"
                          icon="icon-search" title="机构列表" textname="shortname" isclear="true" />
			</td>
		</tr>
		<tr>
			<td align="right">
				<label class="Validform_label">所在省市:</label>
			</td>
			<td class="value">
				<input id="tsTerritoryId" name="province.id" type="hidden" value="${zyCinemaPage.province.id}"/>
				<input id="tsTerritoryName" type="text" readonly="readonly" value="${zyCinemaPage.province.territoryName}" style="width: 150px" class="inputxt" datatype="*" nullmsg="请选择市 "/>
				<t:choose hiddenName="tsTerritoryId" hiddenid="id" inputTextname="tsTerritoryName" textname="text"  
					title="机型" url="territoryController.do?goChooseTerritoryForCm" name="chooseTerritoryList" width="600px" height="600px"
					icon="icon-search"  isclear="true" />
			</td>
			<td align="right">
				<label class="Validform_label">地址:</label>
			</td>
			<td class="value">
				<input id="address" name="address" type="text" style="width: 260px" class="inputxt" value='${zyCinemaPage.address}' datatype="*" nullmsg="请填写地址"/>
			</td>
		</tr>
		<tr>
			<td align="right">
				<label class="Validform_label">电话:</label>
			</td>
			<td class="value">
				<input id="phone" name="phone" type="text" style="width: 150px" class="inputxt" value='${zyCinemaPage.phone}' />
			</td>
			<td align="right">
				<label class="Validform_label">传真:</label>
			</td>
			<td class="value">
				<input id="fax" name="fax" type="text" style="width: 150px" class="inputxt"  value='${zyCinemaPage.fax}' />
			</td>
		</tr>
		<tr>
			<td align="right">
				<label class="Validform_label">影院编码:</label>
			</td>
			<td class="value">
				<input id="code" name="code" type="text" style="width: 150px" class="inputxt" value='${zyCinemaPage.code}' />
			</td>
			<td align="right">
				<label class="Validform_label">服务状态:</label>
			</td>
			<td class="value">
				<t:dictSelect field="isService" defaultVal='${zyCinemaPage.isService}' type="select" typeGroupCode="<%=StaticValue.DIC_CINEMA_SERVICE %>"  hasPleaseSelect="false"/>
			</td>
		</tr>
		<tr>
			<td align="right">
				<label class="Validform_label">是否异常:</label>
			</td>
			<td class="value">
				<t:dictSelect field="isNormal" defaultVal='${zyCinemaPage.isNormal}' type="radio" typeGroupCode="<%=StaticValue.DIC_TRUE_OR_FALSE_NUM %>"  hasPleaseSelect="false"/>
			</td>
		
			<td align="right">
				<label class="Validform_label">异常原因:</label>
			</td>
			<td class="value">
				<input id="exceptionReason" name="exceptionReason" type="text" style="width: 150px" class="inputxt" value='${zyCinemaPage.exceptionReason}' />
				<span class="Validform_checktip"></span>
			</td>
		</tr>
		<tr>
			<td align="right">
				<label class="Validform_label">是否有TMS:</label>
			</td>
			<td class="value">
				<t:dictSelect field="isTms" defaultVal='${zyCinemaPage.isTms}' type="select" typeGroupCode="<%=StaticValue.DIC_TRUE_OR_FALSE_NUM %>"  />
			</td>
			<td align="right">
				<label class="Validform_label">是否有NOC:</label>
			</td>
			<td class="value">
				<t:dictSelect field="isNoc" defaultVal='${zyCinemaPage.isNoc}' type="select" typeGroupCode="<%=StaticValue.DIC_TRUE_OR_FALSE_NUM %>"  />
			</td>
		</tr>
		<tr>
			<td align="right">
				<label class="Validform_label">经纬度:</label>
			</td>
			<td class="value">
				<input id="latitude" name="latitude" type="text" style="width: 150px" class="inputxt" value='${zyCinemaPage.latitude}' />
			</td>
			<td align="right">
				<label class="Validform_label">经营方式:</label>
			</td>
			<td class="value">
				<t:dictSelect field="business" type="select" defaultVal='${zyCinemaPage.business}' typeGroupCode="<%=StaticValue.DIC_BUSINESS_WAY %>"  />
			</td>
		</tr>
		<tr>
			<td align="right">
				<label class="Validform_label">影院整改函：</label>
			</td>
			<td colspan="3" class="value">
				<input type="file" value="上传附件" id="taxRegImgUpload" />
				<span id="fileName" hidden>
					<span id="fileUploadname">
						<c:if test="${not empty list}">
							<c:forEach var="name" items="${list}"><a class="color-blue" href="fileUploadController.do?downLoadFile&fileLogId=${name.id}">${name.name}</a>&nbsp;&nbsp;&nbsp;&nbsp;</c:forEach>
						</c:if>
					</span>&nbsp;&nbsp;&nbsp;
					<a onclick='delFile()'>删除</a>
				</span>
			</td>
		</tr>
	</table>
</t:formvalid>
</body>
